﻿<UserControl x:Class="mpost.SilverlightMultiFileUpload.FileRowControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:classes="clr-namespace:mpost.SilverlightMultiFileUpload.Classes">
    <UserControl.Resources>
       <classes:ByteConverter x:Key="ByteConverter" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <!--Style="{StaticResource BorderStyle}"-->
        <Border BorderBrush="Black" BorderThickness="0, 0, 0, 1" Padding="2">  
            <StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Background="White">
            <TextBlock x:Name="FileNameTextBlock" Text="{Binding FileName}" Width="180" Margin="5,0,0,0"  />   
            <TextBlock x:Name="StateTextBlock" Text="{Binding State}" Width="60"/>  
            <TextBlock x:Name="FileSizeTextBlock" Text="{Binding FileSize, Converter={StaticResource ByteConverter}}" Width="60" TextAlignment="Right" Margin="0,0,5,0" /> 
            <TextBlock  Text="{Binding BytesUploaded}" Width="50" TextAlignment="Right" Visibility="Collapsed"/>  
            <ProgressBar x:Name="PercentageProgress" Width="30" Value="{Binding Percentage}"></ProgressBar>
            <StackPanel x:Name="ValidUploadIcon" Width="30" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
                <Image Source="Img/tick.png" Height="15"></Image>
            </StackPanel>
            <TextBlock Text="{Binding Percentage}" Width="20" TextAlignment="Right" Visibility="Collapsed" />   
              
            <Button Style="{StaticResource ImageButtonStyle}" Content="Img/cancel.png" Height="15" Click="Button_Click" Margin="5,0,0,0" />
        </StackPanel>
            <TextBlock Foreground="Red" x:Name="ErrorMsgTextBlock" Visibility="Collapsed">Upload failed.</TextBlock>
                </StackPanel>
        </Border>

    </Grid>
</UserControl>
